import 'package:color_dart/RgbaColor.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:im_flutter_sdk_example/jsonserialize/need/data.dart';

class HeadInfo extends StatelessWidget {
  final NeedData item;
  const HeadInfo({Key key, this.item}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
        child: Container(
            color: Colors.white,
            padding: EdgeInsets.symmetric(horizontal: 17, vertical: 10),
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              children: [
                Text(
                  '${item.title}',
                  style: TextStyle(
                      color: rgba(68, 68, 68, 1),
                      fontSize: 18,
                      fontWeight: FontWeight.bold),
                  maxLines: 2,
                  overflow: TextOverflow.ellipsis,
                ),
                Container(
                    padding: EdgeInsets.only(top: 10, bottom: 10),
                    child: Column(children: [
                      Row(
                        children: [
                          Text(
                            '领        域：',
                            style: TextStyle(
                                color: rgba(107, 107, 107, 1), fontSize: 14),
                          ),
                          Text(
                            '${item.technicalFieldDesc}',
                            style: TextStyle(
                                color: rgba(68, 68, 68, 1), fontSize: 14),
                          ),
                        ],
                      ),
                      Row(
                        children: [
                          Text(
                            '需求类型：',
                            style: TextStyle(
                                color: rgba(107, 107, 107, 1), fontSize: 14),
                          ),
                          Text(
                            '${item.typeLabel}',
                            style: TextStyle(
                                color: rgba(68, 68, 68, 1), fontSize: 14),
                          ),
                        ],
                      ),
                      Row(
                        children: [
                          Text(
                            '需  求  方：',
                            style: TextStyle(
                                color: rgba(107, 107, 107, 1), fontSize: 14),
                          ),
                          Text(
                            '${item.userName}',
                            style: TextStyle(
                                color: rgba(68, 68, 68, 1), fontSize: 14),
                          ),
                        ],
                      ),
                      Row(
                        children: [
                          Text(
                            '所  在  地：',
                            style: TextStyle(
                                color: rgba(107, 107, 107, 1), fontSize: 14),
                          ),
                          Text(
                            '${item.provinceLabel}${item.cityLabel}',
                            style: TextStyle(
                                color: rgba(68, 68, 68, 1), fontSize: 14),
                          ),
                        ],
                      ),
                    ])),
                Row(
                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
                  children: [
                    Column(
                      crossAxisAlignment: CrossAxisAlignment.start,
                      children: [
                        item.budget == "-1"
                            ? Text(
                                '面议',
                                style: TextStyle(
                                    color: rgba(235, 101, 13, 1), fontSize: 17),
                              )
                            : Text(
                                '¥ ${item.budget} 万',
                                style: TextStyle(
                                    color: rgba(235, 101, 13, 1), fontSize: 17),
                              ),
                        Padding(padding: EdgeInsets.only(bottom: 5)),
                        Text(
                          '预算',
                          style: TextStyle(
                              color: rgba(163, 163, 163, 1), fontSize: 13),
                        ),
                      ],
                    ),
                    Column(
                      crossAxisAlignment: CrossAxisAlignment.start,
                      children: [
                        Text(
                          '2020/08/21',
                          style: TextStyle(
                              color: rgba(68, 68, 68, 1), fontSize: 17),
                        ),
                        Padding(padding: EdgeInsets.only(bottom: 5)),
                        Text(
                          '截止日期',
                          style: TextStyle(
                              color: rgba(163, 163, 163, 1), fontSize: 13),
                        ),
                      ],
                    ),
                    Column(
                      crossAxisAlignment: CrossAxisAlignment.start,
                      children: [
                        Container(
                          child: Stack(
                            children: [
                              Row(
                                children: [
                                  Padding(
                                    padding: EdgeInsets.only(left: 5),
                                  ),
                                  Text(
                                    '22',
                                    style: TextStyle(
                                        color: rgba(235, 101, 13, 1),
                                        fontSize: 15),
                                  ),
                                  Padding(
                                    padding: EdgeInsets.only(left: 5),
                                  ),
                                  Text(
                                    '天',
                                    style: TextStyle(
                                        color: rgba(68, 68, 68, 1),
                                        fontSize: 17),
                                  ),
                                  Padding(
                                    padding: EdgeInsets.only(left: 5),
                                  ),
                                  Text(
                                    '22',
                                    style: TextStyle(
                                        color: rgba(235, 101, 13, 1),
                                        fontSize: 15),
                                  ),
                                  Padding(
                                    padding: EdgeInsets.only(left: 5),
                                  ),
                                  Text(
                                    '时',
                                    style: TextStyle(
                                        color: rgba(68, 68, 68, 1),
                                        fontSize: 17),
                                  ),
                                ],
                              ),
                              Positioned(
                                left: 3,
                                child: Align(
                                  child: Container(
                                    height: 25,
                                    width: 22,
                                    child: SizedBox(
                                      width: 25,
                                      height: 22,
                                      child: Image.asset(
                                        'lib/assets/images/need/time.png',
                                      ),
                                    ),
                                  ),
                                ),
                              ),
                              Positioned(
                                left: 47,
                                child: Align(
                                  child: Container(
                                    height: 25,
                                    width: 22,
                                    child: SizedBox(
                                      width: 25,
                                      height: 22,
                                      child: Image.asset(
                                        'lib/assets/images/need/time.png',
                                      ),
                                    ),
                                  ),
                                ),
                              )
                            ],
                          ),
                        ),
                        Padding(padding: EdgeInsets.only(bottom: 5)),
                        Text(
                          '距离截止时间',
                          style: TextStyle(
                              color: rgba(163, 163, 163, 1), fontSize: 13),
                        ),
                      ],
                    )
                  ],
                )
              ],
            )));
  }
}
